//
//  XHRVerticalButton.m
//  百思不得姐
//
//  Created by 胥鸿儒 on 16/6/12.
//  Copyright © 2016年 xuhongru. All rights reserved.
//

#import "XHRVerticalButton.h"

@implementation XHRVerticalButton
- (void)setupUI
{
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    self.adjustsImageWhenHighlighted = NO;
    self.backgroundColor = [UIColor whiteColor];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    return self;
}

- (void)awakeFromNib
{
    [self setupUI];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    //设置imageView的尺寸
    self.imageView.xhr_Width = self.xhr_Width * 0.5;
    self.imageView.xhr_Height = self.imageView.xhr_Width;
    self.imageView.xhr_Y = self.xhr_Height * 0.15;
    self.imageView.xhr_CenterX = self.xhr_Width * 0.5;
    
    //设置label的尺寸
    self.titleLabel.xhr_Width = self.xhr_Width;
    self.titleLabel.xhr_X = 0;
    self.titleLabel.xhr_Y = CGRectGetMaxY(self.imageView.frame) + 10;
    self.titleLabel.xhr_Height = 20;
}
@end
